#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtGui/QMainWindow>
#include "erom.h"
#include <QSettings>
#include <QextSerialPort>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT
    
public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    ERom *rom;
    void openCom(void);
    int comflag;
protected:
    QSettings *settings;
    QByteArray Srecord;
    Index Sindex;

    QextSerialPort *comm;

    void changeEvent(QEvent *e);
    
private slots:

    void on_pushButton_exit_clicked();

    void on_pushButton_open_clicked();

    void on_pushButton_addrecord_clicked();

    void on_textEdit_recordata_textChanged();

    void on_comboBox_recordname_textChanged(const QString &arg1);

    void on_action_New_triggered();

    void on_pushButton_save_clicked();

    void on_pushButton_changeRecord_clicked();

    void change_rom_infomation(void);

    void on_pushButton_saveas_clicked();

    void on_pushButton_del_clicked();

    void on_comboBox_recordname_currentIndexChanged(const QString &arg1);

    void on_comboBox_recordname_editTextChanged(const QString &arg1);

    void on_pushButton_write_clicked();

    void on_pushButton_read_clicked();

    void on_comboBox_com_bote_currentIndexChanged(const QString &arg1);

    void on_comboBox_com_select_currentIndexChanged(const QString &arg1);

private:
    Ui::MainWindow *ui;
};

#endif // MAINWINDOW_H
